import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    Navigator,
    Image,
    TouchableOpacity,
    Dimensions,
    ScrollView,
    Alert,
    BackAndroid,
} from 'react-native';
import ImageWrapper from './ImageWrapper';
var {width,height} = Dimensions.get('window');
export default class NavigationBar extends Component {

    render() {
        var left = this.props.leftIcon;
        var right = this.props.rightIcon;
        var rightText = this.props.rightText;
        return (
            <View style={styles.container}>
                {left?<TouchableOpacity onPress={this.props.leftPress}>
                    <View>
                        <ImageWrapper style={this.props.leftStyle} icon={left}/>
                    </View>
                    </TouchableOpacity>:<View style={{width:20}}></View>}
                <View style={{flex:1,justifyContent:'center',alignItems:'center'}}>
                    <Text style={{color:'#fff',fontSize:18}}>{this.props.titleText}</Text>
                </View>
                {right?<TouchableOpacity onPress={this.props.rightPress}>
                        <View>
                            <ImageWrapper style={this.props.rightStyle} icon={right}/>
                        </View>
                    </TouchableOpacity>:(rightText?<TouchableOpacity onPress={this.props.rightTextPress}><View style={{height:50,justifyContent:'center',marginRight:10}}><Text style={this.props.rightTextStyle}>{rightText}</Text></View></TouchableOpacity>:<View style={{width:20}}></View>)}
            </View>
        );
    };


     
}



const styles = StyleSheet.create({
    container: {
        width:width,
        height:50,
        justifyContent:'center',
        alignItems:'center',
        flexDirection:'row',
        backgroundColor:'rgb(79,145,237)'
    },

})